package com.fq.wechat.util;

import com.fq.wechat.constant.CommonConstant;
import com.fq.wechat.constant.MsgKey;

import java.util.HashMap;
import java.util.Map;

/**
 * @author jifang.
 * @since 2016/4/18 17:36.
 */
public class ResponseContainer {

    public static final String VOICE_MSG_FORMATTER =
            new StringBuilder("<xml>\n")
                    .append("\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n")
                    .append("\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n")
                    .append("\t\t\t\t<CreateTime>%s</CreateTime>\n")
                    .append("\t\t\t\t<MsgType><![CDATA[music]]></MsgType>\n")
                    .append("\t\t\t\t<Music>")
                    .append("\t\t\t\t\t\t\t\t<Title><![CDATA[%s]]></Title>")
                    .append("\t\t\t\t\t\t\t\t<Description><![CDATA[]]></Description>")
                    .append("\t\t\t\t\t\t\t\t<MusicUrl><![CDATA[%s]]></MusicUrl>")
                    .append("\t\t\t\t\t\t\t\t<HQMusicUrl><![CDATA[%s]]></HQMusicUrl>")
                    .append("\t\t\t\t</Music>")
                    .append("</xml>")
                    .toString();
    
    public static final Map<String, String> TEXT = new HashMap<>();

    public static final Map<String, String> ERROR_TEXT = new HashMap<>();

    public static final Map<String, String> MUSIC = new HashMap<>();

    public static final Map<String, String> ERROR_MUSIC = new HashMap<>();

    public static final Map<String, String> FAN_STATUS = new HashMap<>();

    static {
        // 台灯
        TEXT.put(MsgKey.L_ON, "云家居即将打开您的台灯!");
        TEXT.put(MsgKey.L_OFF, "云家居即将关闭您的台灯!");
        TEXT.put(MsgKey.L_STATUS, "当前台灯是%s状态");

        // 温度
        TEXT.put(MsgKey.T_STATUS, "当前室温为%s℃");

        // 湿度
        TEXT.put(MsgKey.H_STATUS, "当前湿度为%s%%RH");

        // 风扇
        TEXT.put(MsgKey.F_ON, "云家居即将打开您的风扇!");
        TEXT.put(MsgKey.F_OFF, "云家居即将关闭您的风扇!");
        TEXT.put(MsgKey.F_FASTER, "您的风扇正在加速!");
        TEXT.put(MsgKey.F_SLOWER, "您的风扇正在减速!");
        TEXT.put(MsgKey.F_STATUS, "当前风扇是%s状态");

        // 提示
        TEXT.put(MsgKey.E_MANUAL, "命令\" %s \"暂时不支持, 请点击右下角查看用户手册");
    }

    static {
        // 台灯
        MUSIC.put(MsgKey.L_ON,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E4%BA%91%E5%AE%B6%E5%B1%85%E5%8D%B3%E5%B0%86%E6%89%93%E5%BC%80%E6%82%A8%E7%9A%84%E5%8F%B0%E7%81%AF.wav");
        MUSIC.put(MsgKey.L_OFF,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E4%BA%91%E5%AE%B6%E5%B1%85%E5%8D%B3%E5%B0%86%E5%85%B3%E9%97%AD%E6%82%A8%E7%9A%84%E5%8F%B0%E7%81%AF.wav");
        MUSIC.put(MsgKey.L_STATUS,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E6%93%8D%E4%BD%9C%E6%9A%82%E4%B8%8D%E6%94%AF%E6%8C%81%E8%AF%AD%E9%9F%B3%E6%92%AD%E6%94%BE.wav");

        // 温度
        MUSIC.put(MsgKey.T_STATUS,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E6%93%8D%E4%BD%9C%E6%9A%82%E4%B8%8D%E6%94%AF%E6%8C%81%E8%AF%AD%E9%9F%B3%E6%92%AD%E6%94%BE.wav");

        MUSIC.put(MsgKey.H_STATUS,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E6%93%8D%E4%BD%9C%E6%9A%82%E4%B8%8D%E6%94%AF%E6%8C%81%E8%AF%AD%E9%9F%B3%E6%92%AD%E6%94%BE.wav");

        // 风扇
        MUSIC.put(MsgKey.F_ON,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E4%BA%91%E5%AE%B6%E5%B1%85%E5%8D%B3%E5%B0%86%E6%89%93%E5%BC%80%E6%82%A8%E7%9A%84%E9%A3%8E%E6%89%87.wav");
        MUSIC.put(MsgKey.F_OFF,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E4%BA%91%E5%AE%B6%E5%B1%85%E5%8D%B3%E5%B0%86%E5%85%B3%E9%97%AD%E6%82%A8%E7%9A%84%E9%A3%8E%E6%89%87!.wav");
        MUSIC.put(MsgKey.F_FASTER,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E6%82%A8%E7%9A%84%E9%A3%8E%E6%89%87%E6%AD%A3%E5%9C%A8%E5%8A%A0%E9%80%9F.wav");
        MUSIC.put(MsgKey.F_SLOWER,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E6%82%A8%E7%9A%84%E9%A3%8E%E6%89%87%E6%AD%A3%E5%9C%A8%E5%87%8F%E9%80%9F.wav");
        MUSIC.put(MsgKey.F_STATUS,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E6%93%8D%E4%BD%9C%E6%9A%82%E4%B8%8D%E6%94%AF%E6%8C%81%E8%AF%AD%E9%9F%B3%E6%92%AD%E6%94%BE.wav");

        // 提示
        MUSIC.put(MsgKey.E_MANUAL,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E6%82%A8%E8%BE%93%E5%85%A5%E7%9A%84%E5%91%BD%E4%BB%A4%E6%9A%82%E4%B8%8D%E6%94%AF%E6%8C%81%2C%20%E8%AF%B7%E7%82%B9%E5%87%BB%E5%8F%B3%E4%B8%8B%E8%A7%92%E6%9F%A5%E7%9C%8B%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C.wav");
    }

    static {
        // 台灯
        ERROR_TEXT.put(MsgKey.L_ON, "当前台灯已是开启状态, 无需再开!");
        ERROR_TEXT.put(MsgKey.L_OFF, "当前台灯已是关闭状态, 无需再关!");

        // 风扇
        ERROR_TEXT.put(MsgKey.F_ON, "当前风扇已是开启状态, 无需再开!");
        ERROR_TEXT.put(MsgKey.F_OFF, "当前风扇已是关闭状态, 无需再关!");
        ERROR_TEXT.put(MsgKey.F_FASTER, "当前风扇已达到最快, 再快就爆炸了!");
        ERROR_TEXT.put(MsgKey.F_SLOWER, "当前风扇已经关闭, 您还想干啥!");
    }

    static {
        // 台灯
        ERROR_MUSIC.put(MsgKey.L_ON,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E5%8F%B0%E7%81%AF%E5%B7%B2%E6%98%AF%E5%BC%80%E5%90%AF%E7%8A%B6%E6%80%81%2C%20%E6%97%A0%E9%9C%80%E5%86%8D%E5%BC%80.wav");
        ERROR_MUSIC.put(MsgKey.L_OFF,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E5%8F%B0%E7%81%AF%E5%B7%B2%E6%98%AF%E5%85%B3%E9%97%AD%E7%8A%B6%E6%80%81%2C%20%E6%97%A0%E9%9C%80%E5%86%8D%E5%85%B3!.wav");

        ERROR_MUSIC.put(MsgKey.F_ON,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E9%A3%8E%E6%89%87%E5%B7%B2%E6%98%AF%E5%BC%80%E5%90%AF%E7%8A%B6%E6%80%81%2C%20%E6%97%A0%E9%9C%80%E5%86%8D%E5%BC%80!.wav");
        ERROR_MUSIC.put(MsgKey.F_OFF,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E9%A3%8E%E6%89%87%E5%B7%B2%E6%98%AF%E5%85%B3%E9%97%AD%E7%8A%B6%E6%80%81%2C%20%E6%97%A0%E9%9C%80%E5%86%8D%E5%85%B3!.wav");
        ERROR_MUSIC.put(MsgKey.F_FASTER,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E9%A3%8E%E6%89%87%E5%B7%B2%E8%BE%BE%E5%88%B0%E6%9C%80%E5%BF%AB%2C%20%E5%86%8D%E5%BF%AB%E5%B0%B1%E7%88%86%E7%82%B8%E4%BA%86!.wav");
        ERROR_MUSIC.put(MsgKey.F_SLOWER,
                "http://7xrgh9.com1.z0.glb.clouddn.com/%E5%BD%93%E5%89%8D%E9%A3%8E%E6%89%87%E5%B7%B2%E7%BB%8F%E5%85%B3%E9%97%AD%2C%20%E6%82%A8%E8%BF%98%E6%83%B3%E5%B9%B2%E5%95%A5!.wav");
    }

    static {
        FAN_STATUS.put(CommonConstant.ON, "标准");
        FAN_STATUS.put(CommonConstant.OFF, "关闭");
        FAN_STATUS.put(CommonConstant.FAST, "快速");
        FAN_STATUS.put(CommonConstant.SLOW, "慢速");
    }
}
